define([
], function () {

    var controller = BackboneMVC.Controller.extend({

        name: 'sidebarManager',

        show: function () {
            require(['views/sidebar/sidebar'], function (View) {
                var view = new View();
                view.setElement("body");
                view.render();
            });
        },
        addView: function (key, element, callback) {
            var added;
            switch (key) {
                case "map":
                    require(['controllers/map/mapManager'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "session-manager":
                    require(['controllers/security/sessions'], function (Controller) {
                        (new Controller()).show();
                    });
                    added = true;
                    break;

                case "dashboard_mngr":
                    require(['controllers/home/home'], function (Controller) {
                        (new Controller()).showMainDashboard(element);
                    });
                    added = true;
                    break;

                case "company_mngr":
                    require(['controllers/crud/companyMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "rol_mngr":
                    require(['controllers/crud/rolMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "user_mngr":
                    require(['controllers/crud/userMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "group_mngr":
                    require(['controllers/crud/groupMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "preference_mngr":
                    require(['controllers/crud/preferenceMngr'], function (Controller) {
                        (new Controller()).show();
                    });
                    added = true;
                    break;
                case "solution_mngr":
                    require(['controllers/crud/solutionMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "solution_new":
                    require(['controllers/crud/solutionMngr'], function (Controller) {
                        (new Controller()).newSolution(element);
                    });
                    added = true;
                    break;
                case "project_mngr":
                    require(['controllers/crud/projectMngr'], function (Controller) {
                        (new Controller()).show(element);
                    });
                    added = true;
                    break;
                case "project_new":
                    require(['controllers/crud/projectMngr'], function (Controller) {
                        (new Controller()).newProject(element);
                    });
                    added = true;
                    break;

                default:
                    break;
            }
            return added;
        }
    });
    return controller;
});